import React, { Component } from 'react';
import router from 'umi/router';
import { connect } from 'dva';
import { Input } from 'antd';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';

@connect()
class MyAudit extends Component {
  handleTabChange = key => {
    const { match } = this.props;
    switch (key) {
      case 'auditUndo':
        router.push(`${match.url}/auditUndo`);
        break;
      case 'auditDone':
        router.push(`${match.url}/auditDone`);
        break;
      default:
        break;
    }
  };

  handleFormSubmit = value => {
    // eslint-disable-next-line
    console.log(value);
  };

  render() {
    const tabList = [
      {
        key: 'auditUndo',
        tab: '未审批',
      },
      {
        key: 'auditDone',
        tab: '已审批',
      },
    ];



    const { match, children, location } = this.props;

    return (
      <PageHeaderWrapper
        title="我的审批"
        tabList={tabList}
        tabActiveKey={location.pathname.replace(`${match.path}/`, '')}
        onTabChange={this.handleTabChange}
      >
        {children}

      </PageHeaderWrapper>
    );
  }
}

export default MyAudit;
